package com.wzgl.core.model;

import java.util.ArrayList;
import java.util.List;

import com.jfinal.kit.StrKit;
import com.jfinal.plugin.activerecord.Page;
import com.wzgl.core.base.Table;
import com.wzgl.core.baseModel.BaseWebSite;

@Table(tableName = "twebsite", primaryKey = "fid")
public class TwebSite extends BaseWebSite<TwebSite>{
	private static final long serialVersionUID = -1L;
	public static final TwebSite dao = new TwebSite();
	
	public Page<TwebSite> paginate(int pageNumber, int pageSize,TwebSite t) {
		String sql= " from twebsite where 1 = 1";
		List<Object> agrs = new ArrayList<Object>();
		if(t.getFstatus() != null){
			sql += " and fstatus = ?";
			agrs.add(t.getFstatus());
		}
		if(!StrKit.isBlank(t.getFdesc())){
			sql += "  and fdesc like '%"+t.getFdesc()+"%' ";
		}
		sql += "  order by fctime desc";
		return paginate(pageNumber, pageSize, "select *", sql,agrs.toArray());
	}
}
